UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'v4iAXO5wtGxs/PVwNRb5IRUNhL/gElIv7CWOyGl+eR4='
WHERE
key_id = '34f88bf874f5998271ddbfc8cfac9215ea4ecb07f21c80329ad905068ea3cfe9'
AND (
token = 'v4iAXO5wtGxs/PVwNRb5IRUNhL/gElIv7CWOyGl+eR4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)