UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/fluy67kC2MzmE+St+41vZJR3FYhp4DtLYXlMmesdsY=' 
WHERE 
  key_id = '6f5eca14f5c8a6ffff644a7055cd78e1eca6d214002d9d4944163b4f65da82af' 
  AND (
    token = '/fluy67kC2MzmE+St+41vZJR3FYhp4DtLYXlMmesdsY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027