UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F1ssZWRLBetOxlt6/VWD9Udwp19LoH1FGsFw566VVNE='
WHERE
key_id = 'cca906f2f366e2edf3aaaeb0f0ef8f70b2bf55f20fb94aedc09b74646c1d1591'
AND (
token = 'F1ssZWRLBetOxlt6/VWD9Udwp19LoH1FGsFw566VVNE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)