UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sjzXjMJy8qhVnG0I2c+3y/D2STXC9aPEwx27/MQQOQw='
WHERE
key_id = '040b3044b569577ad272c3bcd3b49d767bfa72ac54298098a4475a6e8ba0f4b6'
AND (
token = 'sjzXjMJy8qhVnG0I2c+3y/D2STXC9aPEwx27/MQQOQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)