UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'RHh9r6on65U8d8WGVo9KtXg75pUGz533dUykJvX+JeU=' 
WHERE 
  key_id = '0be211378685cd6bb94ef4f903b73f78bc054de11d52807d08cb79d4b02708f7' 
  AND (
    token = 'RHh9r6on65U8d8WGVo9KtXg75pUGz533dUykJvX+JeU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019