UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fd/Aqn9gvJCe5n79cQCZ46nk9a2e17asJ9Y61W4Oteo='
WHERE
key_id = '299fcac3fa9b698ccc6ad42231a0bc56967659a380795c54f6aaf4b40620b88d'
AND (
token = 'fd/Aqn9gvJCe5n79cQCZ46nk9a2e17asJ9Y61W4Oteo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)