UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AdRZFi1mpep1UEQpn2qFzxKnpECS/rg6L2yVcQY9sm0='
WHERE
key_id = '89720f3a76c030408c83e19450760ad6c6f866dab0d785b5af29299103bfd590'
AND (
token = 'AdRZFi1mpep1UEQpn2qFzxKnpECS/rg6L2yVcQY9sm0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)