UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VBsPe5P727wZPcJWI/ImfejBW8frhOQn1yRx0V8Md5Q='
WHERE
key_id = '203269b9fe3e645fdd41af26f2c3a4ab71e026af0ea2dd41842f0e5aca3dea3c'
AND (
token = 'VBsPe5P727wZPcJWI/ImfejBW8frhOQn1yRx0V8Md5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)