UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2ZU437p99sUtK4GHkdF3EMAPY5Uz9qWowmYeJE2fHYA=' 
WHERE 
  key_id = '70f57cb4a38b35b04382913c2a2a6499bd73b815cd2fde9378847dac7598a33b' 
  AND (
    token = '2ZU437p99sUtK4GHkdF3EMAPY5Uz9qWowmYeJE2fHYA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050