UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KvavPbcZukD6l64OlvNFErreNrmsLIg5GOzbpaKpzwk='
WHERE
key_id = '948fb9065828463f48f81859863afb6a41f78f98044939fa95f413f325381467'
AND (
token = 'KvavPbcZukD6l64OlvNFErreNrmsLIg5GOzbpaKpzwk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)