UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'n7apXYDDRspdZIt8TR+4hwGUwu8fCHn0N48phNOzaeI='
WHERE
key_id = '2c00ae5a8f602aaf25c049e888d4d65a6597c53286a1cff5044fd3bf2a1c89d4'
AND (
token = 'n7apXYDDRspdZIt8TR+4hwGUwu8fCHn0N48phNOzaeI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)