UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E3qxbnkJmiIOQ3WZP97U5cU8cM/X/5kR4boAMF/5CM0='
WHERE
key_id = '3066b1124187e11165daf9c90b7f1f272ca80c2b39d3e9e6271d3d342904181b'
AND (
token = 'E3qxbnkJmiIOQ3WZP97U5cU8cM/X/5kR4boAMF/5CM0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)