UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dpnTgtdl9/ZeGKmlrrY42vbLgn4EfIRsPnTtWuY2+jY='
WHERE
key_id = '45952d66bf8017870e90adbd47942dbf724c3913ade3a7dc394dfaf75495a0c2'
AND (
token = 'dpnTgtdl9/ZeGKmlrrY42vbLgn4EfIRsPnTtWuY2+jY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)