UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '25Af2MGmTyG1kMwowOMZv6g7L6+X69EzBFkvmxPlC+o='
WHERE
key_id = '9e014a46172003b17e6bee674f4d6c51840a8ff944039709f4369d5ab97e4c06'
AND (
token = '25Af2MGmTyG1kMwowOMZv6g7L6+X69EzBFkvmxPlC+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)