UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ba98Q80Y2d51wsehuH/yIaMyMUnpvc4iP6RR+gaWAGw='
WHERE
key_id = '9d8a8019e763fe54b7772a3f06a725a4c49dbdff92498610992b290894650392'
AND (
token = 'Ba98Q80Y2d51wsehuH/yIaMyMUnpvc4iP6RR+gaWAGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)