UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vVitBM+YtelWtLndUqEl4/pIQmxdJHor9CFTUYRa0ns='
WHERE
key_id = '6e874c87d88650dab6bfc518a207d34028cede43a794e68c3ee0b3e7636fc523'
AND (
token = 'vVitBM+YtelWtLndUqEl4/pIQmxdJHor9CFTUYRa0ns='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)