UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u1Flo5hLLJr0Sw4/746HY9PaEKu1ifPARyMctk21rWA=' 
WHERE 
  key_id = 'cd2c37896d152f4f96f21712e9cf88927a9c3cf863e7d7e61b6233eb9c9546a0' 
  AND (
    token = 'u1Flo5hLLJr0Sw4/746HY9PaEKu1ifPARyMctk21rWA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024