UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Mdxm2q5UH1v2MRrf5FHN/XexZbyvJOFh8rI4nYOcs2A='
WHERE
key_id = '245ac499f7422a97c44d81999d0b71b017f875a1921201a00347a25b55de9a76'
AND (
token = 'Mdxm2q5UH1v2MRrf5FHN/XexZbyvJOFh8rI4nYOcs2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)