UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W2HTXtc7yDQlSIBIfCoq1fr4lCf1YnaKQgCt6jboCMA='
WHERE
key_id = '45424fdd635e0eab71a03f596dd7e828591e56bb55e70b70b48691c32f75f6de'
AND (
token = 'W2HTXtc7yDQlSIBIfCoq1fr4lCf1YnaKQgCt6jboCMA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)