UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hhca0CYvsT1TnecQYP6GQhH/kJ2DIqaBJdfCuE+Kjio='
WHERE
key_id = 'aea637f301a41c0fcc4feeea1ae841d38eb63a1f23eb8c716011ddcfb88f291f'
AND (
token = 'Hhca0CYvsT1TnecQYP6GQhH/kJ2DIqaBJdfCuE+Kjio='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)