UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IxfG3snntgysUL0KEHeANnRXlvnaDabq0y9/o39i28M=' 
WHERE 
  key_id = 'bd9dcc5800b0a37c020f255e1d1b1000969623bb545e1ef635dd5bd4867fc986' 
  AND (
    token = 'IxfG3snntgysUL0KEHeANnRXlvnaDabq0y9/o39i28M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031