UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0GFGy0ggpfQIOK1D6KR6UYVHq5QJgNYaDDnAClD61p4='
WHERE
key_id = '843dab0619bf3d6b242aeaf5928cb6864a7573673398b6d8cf8fbe3ff1f528f0'
AND (
token = '0GFGy0ggpfQIOK1D6KR6UYVHq5QJgNYaDDnAClD61p4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)