UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xtzd8Sqy/J4w8DpLQ28S6puxxsKoTlh2aq24JGy9NsQ=' 
WHERE 
  key_id = 'a8b41d6b1c5fbb31cc742ed1cc65726a08e525547b8083658548a8eaef2c8507' 
  AND (
    token = 'xtzd8Sqy/J4w8DpLQ28S6puxxsKoTlh2aq24JGy9NsQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033