UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'u75yvfSZ6/M+0Awt8c9T16f8Ghf4MLjo53hM6EBsQn0=' 
WHERE 
  key_id = 'd08c696452c8c8362ae3d6906d284b53f29e34b6c3a042078ba43e62452d60ed' 
  AND (
    token = 'u75yvfSZ6/M+0Awt8c9T16f8Ghf4MLjo53hM6EBsQn0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031