UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W9r9OzsKoOHAa4ZM+IJojonAKf/XR+kTuD2gc7MoT2A='
WHERE
key_id = 'c053d7e7dcbada940b11fa43250294afce9209e461ec1c180bc12c9ec4fdbf58'
AND (
token = 'W9r9OzsKoOHAa4ZM+IJojonAKf/XR+kTuD2gc7MoT2A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)