UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'CAgRuxIzSlLQx/OLzVZdWGDfx423BwWNkSgQn8nRnGc=' 
WHERE 
  key_id = '98f0c5e6d071fe2415d0f6fedce15a399c68fcb6f70a6e1ae99926e99f52c94a' 
  AND (
    token = 'CAgRuxIzSlLQx/OLzVZdWGDfx423BwWNkSgQn8nRnGc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036