UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'v6oVo7+kMLQ9lgxArsJ7PcTZ6n0YBoaziXdH6nsGrtE=' 
WHERE 
  key_id = 'c664ade4cab3be93504f64f23b4e1b8882d4a933691c5c1c974716478abc080d' 
  AND (
    token = 'v6oVo7+kMLQ9lgxArsJ7PcTZ6n0YBoaziXdH6nsGrtE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021