UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+IsYlNzvZPsPRsud/GlCkH6m8Zg0LFn4ZxpoETb50AI=' 
WHERE 
  key_id = '2057ff7718065139d9bddecc0542b9d0d34953f82988b89c4db323eaf6f53898' 
  AND (
    token = '+IsYlNzvZPsPRsud/GlCkH6m8Zg0LFn4ZxpoETb50AI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00020