UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LQznL2d7tdM4LggvAvWJFOF/7DU8bGdjYjN91u7vG0g='
WHERE
key_id = '5dd260fa06e84bd56ae4527b162d1173431255f38f7f5191e54ba31f5b8bf1a9'
AND (
token = 'LQznL2d7tdM4LggvAvWJFOF/7DU8bGdjYjN91u7vG0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)