UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9pUM4zGjWmhRJga2nF3MawmAsg96IAWjp+jGAVR8gF0='
WHERE
key_id = '856b33471592ccf5046a9027ec01ac4e52d9d520b0397ed7d30f15b1d9ce5377'
AND (
token = '9pUM4zGjWmhRJga2nF3MawmAsg96IAWjp+jGAVR8gF0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)