UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2O0dfcRzJOvsDfkZfLq6Wh7sKFS90k9EHlSXa1uzfZE='
WHERE
key_id = 'cf5719f3b27d551462efd97b9b247e5ed1e615288e203bd7332ba4a1741b5e0f'
AND (
token = '2O0dfcRzJOvsDfkZfLq6Wh7sKFS90k9EHlSXa1uzfZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)