UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ExMNnhrjWHjufU79eCnGGz2LZ5c6f1oQ9tdqKa93RQM=' 
WHERE 
  key_id = '5f9b884b233eaa72322608c34f58368666d976b103c0fbb39a1060e29b5aee98' 
  AND (
    token = 'ExMNnhrjWHjufU79eCnGGz2LZ5c6f1oQ9tdqKa93RQM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033