UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xt8TpRwFKvx/iyUqulv/A+5my2i3qFRoctxKdbQBlnA=' 
WHERE 
  key_id = '4c2636245dae27c96c11ce3712c94ca4176bba243f3d0c7ffaaea9e5f51db949' 
  AND (
    token = 'Xt8TpRwFKvx/iyUqulv/A+5my2i3qFRoctxKdbQBlnA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025