UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pM9dlOukyMyalXGNue5jiflC5Q1qzgsZ4cRvuljr8FY=' 
WHERE 
  key_id = 'ea10916f3148aa126e4a30978bab609e332de5be9e01f1b914e3863772c511de' 
  AND (
    token = 'pM9dlOukyMyalXGNue5jiflC5Q1qzgsZ4cRvuljr8FY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026