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