UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Ie7lADzBzo1Vo8azkQ/0dOzwtHCkm5vuwQtvBCHjUHI=' 
WHERE 
  key_id = '068ce93345e5d9b329f7934e6ccd12ab03b1e9c7a98ee5c5419b08fcdf15ae85' 
  AND (
    token = 'Ie7lADzBzo1Vo8azkQ/0dOzwtHCkm5vuwQtvBCHjUHI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017