UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FqHeYes+QqxMXSkerG4uXnO0wh0SGmOs2Kn5axX7IIQ=' 
WHERE 
  key_id = '0933e511acba0014e9c3e31557f744a0e244e5b2e63643f34be48b738f97ee2b' 
  AND (
    token = 'FqHeYes+QqxMXSkerG4uXnO0wh0SGmOs2Kn5axX7IIQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052