UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eLTMthjC92IPl3Tnu2eHo7weUX5kzKTifqjQADL4N/s=' 
WHERE 
  key_id = '9cb36fcc35465e4463dce0bb1805ed6ae3fbb68be4868b9106abdb3347a22bd5' 
  AND (
    token = 'eLTMthjC92IPl3Tnu2eHo7weUX5kzKTifqjQADL4N/s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021