UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Agp8OLnSmJM1Y/yy5uTFawfN3Aov+aoXn+P6AFwHSs='
WHERE
key_id = '43f38f30f2544b0080c0c528e81e1736b5d5f44af28e80fbd9bf1b738f1f82cc'
AND (
token = '5Agp8OLnSmJM1Y/yy5uTFawfN3Aov+aoXn+P6AFwHSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)