UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'axw2xz26gA1agCw0T8YscB3THgWY2vLg4lKeNcIlODU='
WHERE
key_id = 'b0893d65669814b0c17ad0c194d5c36f72fccb7f9f48a5cc3ec7f2690dd83ae6'
AND (
token = 'axw2xz26gA1agCw0T8YscB3THgWY2vLg4lKeNcIlODU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)