UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pxtNQdp/4arXq/OWv+M+p58/5bCafXSJKHTyWhLMpBc='
WHERE
key_id = '31595d520a91ba3364bf71c70a60d7da80772cefb843878184e4c84cc3278adf'
AND (
token = 'pxtNQdp/4arXq/OWv+M+p58/5bCafXSJKHTyWhLMpBc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)