UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hIL9pdPwKSmGGKuhCR+ZrdbMxDi4kLkBmQy0YSGkdrw='
WHERE
key_id = 'e6ef3ea2e34bc8e886ac9666e1d697f9b6916f9d3ad2f6a03d4f954ff7970ea4'
AND (
token = 'hIL9pdPwKSmGGKuhCR+ZrdbMxDi4kLkBmQy0YSGkdrw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)