UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ez467wm+BwyLyh6GpZ21xJMgfHGyJCY+3bgLenCdjvQ=' 
WHERE 
  key_id = '50bb5be6ffe2eb3569528ad1d12ca5f2ac9a20a96bc07efbfca41c2363a490be' 
  AND (
    token = 'ez467wm+BwyLyh6GpZ21xJMgfHGyJCY+3bgLenCdjvQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022