UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '1Fp45dhcFIBCYmepSajzjfn+oVN0xgGlmwETDrYKb4c=' 
WHERE 
  key_id = 'a88c1f5bf206de637239c9d1bb0a01a3732e6b90b1fe5c7d16c507f0d0f20dab' 
  AND (
    token = '1Fp45dhcFIBCYmepSajzjfn+oVN0xgGlmwETDrYKb4c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00067