UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TVxRuzT30sd503jvL0caaxQNnol7hHMKivGMtaAZJFk='
WHERE
key_id = 'c8726f9e790d1412754f52e3151fa6a19c4b46c8c227d427a555b750aaa3cda6'
AND (
token = 'TVxRuzT30sd503jvL0caaxQNnol7hHMKivGMtaAZJFk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)