UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7yg0rd3NnsuqfXfAb+LGxnmoyeF8YHad7MVeYB1aBFI='
WHERE
key_id = '79c0689ea9341593b00df7f85e15925cd1e2b023ee07069c5bcec75316439db3'
AND (
token = '7yg0rd3NnsuqfXfAb+LGxnmoyeF8YHad7MVeYB1aBFI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)