UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vbTpwd+v4NYGsNXtWlIjjN8x/drS9Qaj4OxTbHUjIjk='
WHERE
key_id = '72d2a43112e58e31e9705ab2402aaac18ac105e58caaa33de1b86ab32b3d3f44'
AND (
token = 'vbTpwd+v4NYGsNXtWlIjjN8x/drS9Qaj4OxTbHUjIjk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)