UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GoqvPDsFusmZBH4BLpl60Yx25xBKXQJfiqMBkRqoHSU=' 
WHERE 
  key_id = '90d2c82e938b42b7647c5bd414d99a3d48785073362b8a73691ea27c7d52901c' 
  AND (
    token = 'GoqvPDsFusmZBH4BLpl60Yx25xBKXQJfiqMBkRqoHSU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022