UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aunKDOa1KMAyl+QiNI9+wnc1pnZNg4WyBxNN+2ax1Uw='
WHERE
key_id = '595d6925f2cc377e1fdd87e74342507ea5a3f9b19a811bf8676befeaa2714f89'
AND (
token = 'aunKDOa1KMAyl+QiNI9+wnc1pnZNg4WyBxNN+2ax1Uw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)