UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eB2VWdsw8HjSTJX//EEGz4YaKs6VUi/xhE2ILpTVlZg=' 
WHERE 
  key_id = 'a5c821db982612b0bafcd641999423781a41c67daf7d32f8f778525fb6ea4f2c' 
  AND (
    token = 'eB2VWdsw8HjSTJX//EEGz4YaKs6VUi/xhE2ILpTVlZg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045