UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jelwQcMRzvHjFjwcyeMOM/Yo1Q09ZuFSnwHxHsipAhI=' 
WHERE 
  key_id = '217eaefd11663d0f3c9376cf2e13eb06dc98fbd505ccb42c5c193a3c9a3eca56' 
  AND (
    token = 'jelwQcMRzvHjFjwcyeMOM/Yo1Q09ZuFSnwHxHsipAhI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024