UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '9P3iUwLrEqgd9wxI6nQ3aAO1ZZHjtfzGb7LanFaNBBs=' 
WHERE 
  key_id = '14b10d036efb8a24f5b57cf6e5837e26fcdcdb6954ff0f91d0a6e875196fcf50' 
  AND (
    token = '9P3iUwLrEqgd9wxI6nQ3aAO1ZZHjtfzGb7LanFaNBBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036