UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rvFombByIZ96tLaY0WK6Iff6SR4EBEDLQKM3fQjYSWw=' 
WHERE 
  key_id = '4a74cae00618c810e6f9c24f0c04bb989a1c24e4f820778adbdfb824177f31f8' 
  AND (
    token = 'rvFombByIZ96tLaY0WK6Iff6SR4EBEDLQKM3fQjYSWw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048