UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XXBaawKXlFkvd4MU0gj/ZQ0O71JkdvVZg3BoUCu9xt4=' 
WHERE 
  key_id = '4c80f1edaad698f4fdf5003938fbc836db9b2242565e7f0c2bd135ba38f74e9b' 
  AND (
    token = 'XXBaawKXlFkvd4MU0gj/ZQ0O71JkdvVZg3BoUCu9xt4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050