UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1hiuGr8P0sg0nXkaIJUmblAkr+28GGozzyMRrX4BzWQ='
WHERE
key_id = '076c80e7dd272fdbd86a899d180d6582558832d10a98ae43a56b302f43bcf39d'
AND (
token = '1hiuGr8P0sg0nXkaIJUmblAkr+28GGozzyMRrX4BzWQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)