UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MDGayLPyCAjMgPAH0HNleHJiB8mcv7ezj6rinI7lHyg='
WHERE
key_id = '76ad3d50124d0eac2ac583ffe46ad47793a4330b53eb46b8811d72ab7a5b9f36'
AND (
token = 'MDGayLPyCAjMgPAH0HNleHJiB8mcv7ezj6rinI7lHyg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)