UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z+/uPTYr6rTMp0d9jNbefzauAtRPTuXSolWGiDRD1O0=' 
WHERE 
  key_id = '86d459aa09313860aaf6fc51576552e7524a389cae520270a2124f4d88e270a9' 
  AND (
    token = 'z+/uPTYr6rTMp0d9jNbefzauAtRPTuXSolWGiDRD1O0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029