UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Lr9X/RqQAN00BLbYgXFaYHEEcAQN8NZSZjem17/1c1o=' 
WHERE 
  key_id = '75f756a26b5ec8c5e90d873815b0262707fb0648c4b105531de5b5acb38ae9f5' 
  AND (
    token = 'Lr9X/RqQAN00BLbYgXFaYHEEcAQN8NZSZjem17/1c1o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049