UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0KXucs+pbboIi5TMU1jN+jFmEedowwKhk71ij5wezZo='
WHERE
key_id = '17cf0102259f9d019e6a3798742f85237b0581c17a3e669466a07314a82c489e'
AND (
token = '0KXucs+pbboIi5TMU1jN+jFmEedowwKhk71ij5wezZo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)